#ifndef UI_HOME_PAGE_H
#define UI_HOME_PAGE_H

#include "sys_port.h"
#include "dev_off.h"
#include "dev_off_line.h"
#include "root.h"

typedef struct 
{

    lv_obj_t * bg_img;
    lv_obj_t * label_title;

    lv_obj_t * label_bottom_left;
    lv_obj_t * label_bottom_mid;
    lv_obj_t * label_bottom_right;

    lv_obj_t * label_hour;
    lv_obj_t * label_colon;
    lv_obj_t * label_min;
    lv_obj_t * label_date;
    lv_obj_t * label_outside_tempera;
    lv_timer_t * timer_home_refresh;

    lv_obj_t * img_ball1;
    lv_obj_t * img_ball2;
    lv_obj_t * img_ball3;

    lv_obj_t * label_electric_heater_title;
    lv_obj_t * label_electric_heater_val;

    lv_obj_t * label_gas_heater_title;
    lv_obj_t * label_gas_heater_val;

    lv_obj_t * label_water_salt_title;
    lv_obj_t * label_water_salt_val;

    lv_obj_t * label_water_TDS_title;
    lv_obj_t * label_water_TDS_val;


    //底部按键光圈效果
    lv_obj_t * btn_left_img;
    lv_obj_t * btn_mid_img;
    lv_obj_t * btn_right_img;
    lv_timer_t * btn_timer;

    uint8_t dev_num; //设备数量
}ui_widget_home_t;

typedef struct 
{
    uint16_t year_t;
    uint8_t month_t;
    uint8_t day_t;
}sys_date_t;

typedef struct 
{
    uint8_t hour_t;
    uint8_t min_t;
    uint8_t sed_t;
}sys_time_t;

void ui_init_home_page_src(lv_obj_t *superview);

static void on_page_home_view_did_load(page_base_t* self);

page_vtable_t* lv_page_home_create(void);

void ui_home_page_common(lv_obj_t *superview);

void ui_home_page_time_big(lv_obj_t *superview);

void timer_home_refresh_cb(lv_timer_t * timer);

void ui_home_page_one_dev(lv_obj_t *superview);

void ui_home_page_two_dev(lv_obj_t *superview);

void ui_home_page_three_dev(lv_obj_t *superview);

void ui_home_page_btn_update(void);

page_method_t* lv_home_page_method(void);

#endif
